﻿import QtQuick 2.12
import QtQuick.Window 2.12
import TaoQuick 1.0
import Top 1.0

Window {
    width: 640
    height: 480
    visible: true
    property  TcpClientManager tcpClient: GlobalManager.tcpClientManager
    title: {
        if(tcpClient.displayIndex != 2) {
            return qsTr("登录页面")
        }else {
            return "客户端" + GlobalManager.tcpClientManager.account + "聊天页面"
        }
    }

    NormalPage {
        id: normapPageId
        anchors.fill: parent
        visible: tcpClient.displayIndex == 0
    }
    RegisterPage {
        id: registerPageId
        anchors.fill: parent
        visible: tcpClient.displayIndex == 1
    }
    CommunicationPage {
        id: comPageId
        anchors.fill: parent
        visible: {
            if(GlobalManager.tcpClientManager.replyCode == 0) {
                tcpClient.displayIndex=2
                return true
            }else {
                return false
            }
        }
    }
}
